package com.bcu.cn.onlineexamsystem.studentmanage.mapper;

import com.bcu.cn.onlineexamsystem.studentmanage.entity.Question;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentQuestionMapper {
    
    @Select("SELECT q.* FROM questions q " +
            "INNER JOIN exam_questions eq ON q.question_id = eq.question_id " +
            "WHERE eq.exam_id = #{examId} " +
            "ORDER BY eq.order_num")
    List<Question> findByExamId(Long examId);
    
    @Select("SELECT * FROM questions WHERE question_id = #{questionId}")
    Question findById(Long questionId);
} 